package com.distributeredis.redis_springboot.spring_fast_json.d01_fastjsontest.jsonfieldtest;

import com.alibaba.fastjson.JSON;
import org.junit.Test;

import java.util.Date;

public class TestJsonField {
    @Test
    public void test() {
        UserPeopleJsonFileld upf = new UserPeopleJsonFileld();
        upf.setUserName("aa");
        upf.setUserAge(11);
        upf.setUserAddress("河南");
        upf.setUserBirthday(new Date());
        String jsonString = JSON.toJSONString(upf);
        System.out.println(jsonString);
        // {"userBirthday":"2024-02-13","name":"aa","userAge":11}
    }
}
